import axios from "../axios.js";
import { BANK } from "../consts.js"


export default {
    //获取银行信息
    getBankData(data,page,limit) {
        return axios({
            url: BANK + `/selectAll/${page}/${limit}`,
            method: 'POST',
            data
        })
    },
    //新增银行
    addBankData(data) {
        return axios({
            url: BANK + "/add",
            method: "PUT",
            data
        })
    },
    //根据id获取银行信息
    getOne(data){
        console.log(data.id)
        return axios({
            url:BANK+"/getOne/"+Number(data.id),
            method:"GET",
            
        })
    },
    //删除银行
    deleteBank(params){
        return axios({
            url:BANK+'/delete',
            method:'GET',
            params
        })
    },
    //修改银行
    updateBank(data){
        return axios({
            url:BANK+"/update",
            method:'PUT',
            data

        })
    },
    //获取图表信息
    getchart() {
        return axios({
            url: '/bill/getEarningsInfo',
            method: "POST",
            data: {
                begin: "2021-04-01",
                end: "2021-04-25",
                type: "定期"
            }
        })
    }

} 